import resolve from "@rollup/plugin-node-resolve";
import vue from "rollup-plugin-vue";
import typescript from "@rollup/plugin-typescript";
import commonjs from "@rollup/plugin-commonjs";

export default {
    input: "./packages/components/index.ts",
    output: {
        file: "dist/es.js",
        name: "FOFFUI",
        format: "es",
    },
    plugins: [
        vue({
            preprocessStyles: true,
            preprocessOptions: {
                typescript: {
                    compilerOptions: {
                        target: 'es2018'
                    }
                }
            }
        }),
        resolve({
            extensions: ['.js', '.ts', '.vue', '.json']
        }),
        commonjs(),
        typescript({
            tsconfig: "./tsconfig.json",
            declaration: true,
            declarationDir: "dist/types",
            rootDir: "./packages",
            exclude: [
                "node_modules/**",
                "**/*.test.ts",
                "**/*.spec.ts",
                "**/*.vue"
            ]
        })
    ],
    external: ["vue"],
};